package com.atguigu.chaptar10

import scala.beans.BeanProperty

object $02_GenericClass {
  /*
  泛型类:  class 类型[T,U,P](属性名:T,属性名:U){
              def 方法名(参数名:P)={...}
          }
   */
  class Person[T,U](@BeanProperty var name:T,@BeanProperty var age:U)//定义泛型类

  def main(args: Array[String]): Unit = {
    val person = new Person[String, Int]("lisi", 20)
    person.getAge
    person.getName
  }

}
